{template header.html}
<script type="text/javascript">
$(function() {
	$(".table-list td").last().css('border-bottom','1px solid #EEEEEE');
	$.getScript("http://www.dayrui.com/index.php?c=sys&m=module_update&data={$store}&admin={SELF}");
});
function dr_module_export(url) {
	var throughBox = $.dialog.through;
	var dr_Dialog = throughBox({title: "生成须知"});
	dr_Dialog.content('<div style="padding:10px 20px"><li style="line-height:27px;list-style:none;">1、将当前模块生成新的字段配置文件</li><li style="line-height:27px;list-style:none;">2、新模块含自定义字段，不含栏目和数据</li><li style="line-height:27px;list-style:none;">3、原config目录数据将备份为_config目录</li><li style="line-height:27px;color:red;list-style:none;">4、当前模块目录必须有可写权限，否则无法创建</li><li style="line-height:45px;list-style:none;">模块新名称： <input id="dr_module_new_name" class="input-text" type="text" style="width:145px" /></li></div>');
	dr_Dialog.button({name: "下一步", callback:function() {
			var win = $.dialog.top;
			var name = win.$("#dr_module_new_name").val();
			location.href = url+"&name="+name;
		},
		focus: true
	});
}
function dr_copy_module(url) {
	var throughBox = $.dialog.through;
	var dr_Dialog = throughBox({title: "{lang('html-514')}"});
	$.ajax({type: "GET", url:url, dataType:'text', success: function (text) {
			var win = $.dialog.top;
			dr_Dialog.content(text);
			dr_Dialog.button({name: "{lang('html-513')}", callback:function() {
					win.$("#mark").val("0"); // 标示可以提交表单
					if (win.dr_form_check()) { // 按钮返回验证表单函数
						var _data = win.$("#myform").serialize();
						$.ajax({type: "POST",dataType:"json", url: url, data: _data, // 将表单数据ajax提交验证
							success: function(data) {
								if (data.status == 1) {
									dr_tips(data.code, 3, 1); 
									setTimeout("window.location.reload(true)", 3000);
								} else {
									dr_tips(data.code, 5); 
									return true;
								}
							},
							error: function(HttpRequest, ajaxOptions, thrownError) {
								alert(HttpRequest.responseText);
							}
						});
					}
					return false;
				},
				focus: true
			});
	    },
	    error: function(HttpRequest, ajaxOptions, thrownError) {
			alert(HttpRequest.responseText);
		}
	});
}
</script>
<style>
.dr_none td {background-color: #f8f8f8;}
</style>
<form action="" method="post" name="myform" id="myform">
<div class="subnav">
	<div class="content-menu ib-a blue line-x">
		{$menu}<span>|</span><a href="{SYS_HELP_URL}83.html" target="_blank"><em>{lang('help')}</em></a>
	</div>
	<div class="bk10"></div>
	<div class="explain-col">
		<font color="gray">{lang('html-157')}</font>
	</div>
	<div class="bk10"></div>
	<div class="table-list">
		<table width="100%">
		<thead>
		<tr>
			<th width="40" align="center">{lang('order')}</th>
			<th width="40" align="center">{lang('html-626')}</th>
			<th width="100" align="left">{lang('html-026')}</th>
			<th width="50" align="left">{lang('html-046')}</th>
			<th width="30" align="center">{lang('html-166')}</th>
			<th width="30" align="center">{lang('html-158')}</th>
			<th hide="1" width="120" align="left">{lang('html-159')}</th>
			<th align="left" class="dr_option">{lang('option')}</th>
		</tr>
		</thead>
		<tbody>
		{loop $list[1] $dir $t}
		<tr>
            <td align="center"><input class="input-text" style="text-align:center;padding-left:0" type="text" name="data[{$t.id}][displayorder]" value="{intval($t.displayorder)}" size="3"/></td>
            <td align="center">{if $this->ci->is_auth('module/edit')}<a href="javascript:;" onClick="return dr_dialog_set('{php echo $t.disabled ? lang('html-161') : lang('html-162');}','{dr_url('module/disabled',array('id'=>$t.id))}');"><img src="{SITE_PATH}dayrui/statics/images/{php echo $t.disabled ? 0 : 1}.gif"></a>{else}<img src="{SITE_PATH}dayrui/statics/images/{php echo $t.disabled ? 0 : 1}.gif"></a>{/if}</td>
			<td align="left">{$t.name}</td>
			<td align="left">{$dir}</td>
			<td align="center"><a href="{dr_url('module/install', array('id'=>$t.id))}">{count($t.site)}</a></td>
            <td align="center">{$t.version}</td>
			<td hide="1" align="left">{$t.author}</td>
			<td align="left" class="dr_option">
			{if $this->ci->is_auth('module/config')}<a class="ago" href="{dr_url('module/config',array('id'=>$t.id, 'all' => 1))}">{lang('061')}</a>{/if}
            {if $this->ci->is_auth('module/install')}<a class="alist" href="{dr_url('module/install', array('id'=>$t.id))}" style="color:green">{lang('358')}</a>{/if}
            {if !$t.nodb}
            {if $this->ci->is_auth('module/config')}<a class="ago" href="javascript:;" onclick="dr_copy_module('{dr_url('module/copy',array('dir'=>$dir))}')">{lang('html-513')}</a>{/if}
			{if SYS_DEBUG}<a class="alist" href="javascript:;" onclick="dr_module_export('{dr_url('module/export',array('dir'=>$dir))}')">{lang('html-516')}</a>{/if}
			{if $this->ci->is_auth('admin/field/index')}<a class="aadd" href="{php echo $duri->uri2url('admin/field/index/rname/module/rid/'.$t.id);}">{lang('html-590')}</a>{/if}
			{if $t.extend && $this->ci->is_auth('admin/field/index')}<a class="aadd" href="{php echo $duri->uri2url('admin/field/index/rname/extend/rid/'.$t.id);}">{lang('html-591')}</a>{/if}
            {if $this->ci->is_auth('mform/index')}<a class="alist" href="{dr_url('mform/index',array('dir'=>$dir))}">{lang('html-663')}</a>{/if}
            {/if}
            {if $this->ci->is_auth('module/uninstall')}<a class="adel" href="javascript:;" onClick="return dr_confirm_url('<font color=red><b>{lang('html-170')}</b></font>','{dr_url('module/uninstall',array('id'=>$t.id))}');">{lang('html-164')}</a>{/if}
			{if !$t['site'][SITE_ID]['use']}<a style="color:red" href="{dr_url('module/install', array('id'=>$t.id))}">[{lang('html-168')}]</a>{/if}
			{if $this->ci->is_auth('module/update')}<a class="aedit dr_update_{$dir}" style="display:none;" href="{dr_url('module/update',array('id'=>$dir))}">{lang('html-167')}</a>{/if}
            {if $t.key}<span class="dr_check_{$dir}">...</span>{/if}
            <span id="dr_domain_{$dir}"></span>
            <script type="text/javascript">
                {loop $t.site $s}
                {if $s.domain}
                    $.get("{dr_url('home/domain', array('domain' => $s.domain))}", function(data){
                        if (data) {
                            $("#dr_domain_{$dir}").html("<a href='{dr_url('module/install',array('id'=>$t.id))}' style='color:red;'>域名解析异常</a>");
                        }
                    });
                    {/if}
                {/loop}
            </script>
			</td>
		</tr>
		{/loop}
		{loop $list[0] $dir $t}
		<tr class="dr_none">
            <td align="center"><input class="input-text" style="text-align:center;padding-left:0" type="text" name="" value="0" size="3"/></td>
            <td align="center">{if $this->ci->is_auth('module/install')}<a href="javascript:void(0);" onclick="dr_install('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FineCMS官方设计室无法全面监控由第三方上传至商店里的应用、模块（以下简称应用程序），因此不保证应用程序的合法性、安全性、完整性、真实性或品质等。您从商店下载应用程序时，同意自行判断并承担所有风险，而不依赖于FineCMS官方设计室。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在任何情况下，FineCMS官方设计室有权依法停止商店服务并采取相应行动，包括但不限于对于相关应用程序进行卸载、暂停服务的全部或部分、保存有关记录并向有关机关报告。由此对您及第三人可能造成的损失，FineCMS官方设计室不承担任何直接、间接或者连带的责任。', '{dr_url('module/install_all', array('dir'=>$dir))}')" style="color:#00F">{else}<a href="javascript:;" style="color:#999">{/if}{lang('html-163')}</a></td>
            <td align="left">{$t.name}</td>
			<td align="left">{$dir}</td>
			<td align="center">0</td>
            <td align="center">{$t.version}</td>
			<td hide="1" align="left">{$t.author}</td>
			<td align="left" class="dr_option">
            {if $admin.adminid == 1}<a class="adel" href="javascript:;" onClick="return dr_confirm_url('<font color=red><b>{lang('html-246')}</b></font>','{dr_url('module/delete',array('dir'=>$dir))}');" style="color:#F00">{lang('del')}</a>{/if}
			</td>
		</tr>
		{/loop}
        {if $this->ci->is_auth('module/edit')}
        <tr>
        <td colspan="8" align="left">
            <input type="submit" class="button" value="{lang('order')}" name="submit" />&nbsp;<div class="onShow">{lang('html-039')}</div>
        </td>
        </tr>
        {/if}
		</tbody>
		</table>
	</div>
</div>
</form>
{template footer.html}